package com.victor9ac.mashup.usecase;

import com.victor9ac.mashup.api.Commentaries;
import com.victor9ac.mashup.contract.CommentsContract;
import com.victor9ac.mashup.port.CommentOperation;
import com.victor9ac.mashup.usecase.auxiliary.CleanupComment;



public class CommentUseCase implements CommentsContract {

	CommentOperation commentOperation;
	
	CleanupComment cleanupComment;


	public Commentaries getRawComments(String keyword){
		
		long ini = System.currentTimeMillis();
		Commentaries commentariesFromKeyword = commentOperation.getCommentariesFromKeyword(keyword);
		long timeElapsed = System.currentTimeMillis() - ini;
		System.out.println("BYE!! "+timeElapsed+"ms.");
		return commentariesFromKeyword;
	}


	public Commentaries getFixedComments(String keyword) {
		Commentaries commentariesFromKeyword = commentOperation.getCommentariesFromKeyword(keyword);
		
		commentariesFromKeyword = cleanupComment.cleanupCommentaries(commentariesFromKeyword);
		
		return commentariesFromKeyword;
	}


	
	
	
	public void setCommentOperation(CommentOperation commentOperation) {
		this.commentOperation = commentOperation;
	}


	public void setCleanupComment(CleanupComment cleanupComment) {
		this.cleanupComment = cleanupComment;
	}


}
